<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width,initical-scale=1,user-scalable=no"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
	if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
		window.location.href="mobile/login";
	}
		
	</script>
<link rel="stylesheet" type="text/css" href="<?=base_url()?>public/css/style1.css" />
<script type="text/javascript" src="<?=base_url()?>public/js/jq.1.12.4.js"></script>
<!--<script type="text/javascript">
try {
var urlhash = window.location.hash;
if (!urlhash.match("fromapp"))
{
if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i)))
{
window.location="http://www.dedaotianhe.com/mobile/login";
}
}
}
catch(err)
{
}</script>-->
<script>
console.log(window.innerWidth);
		if(window.innerWidth<900){
			window.location.href="mobile/login";
		}
	</script>
<title>登陆</title>
<style>
	.nei p span{
		width:27%;
		height:32px;
	}
	.nei p input[tyle=text]{
		width:70%;
		height:32px;
		background:#eefea1;
	}
	.nei p {
		margin:0 0 10px 0;
		height:33px;
	}
	.liji a{
		font-size:12px;
	}
	.content_box>.one{
        position:relative;
    }
    b{
        width: 200px;
		color:red;
		font-weight:100;
		position:absolute;
		top:49%;
		left:67%;
		font-size:12px;
    }
	#bnt-js{
		display: inline-block;
		background: url(/public/img/btn-js.jpg) no-repeat center center / 100% 100%;
		width: 136px;
		height: 41px;
		text-align: center;
		color: white;
		height: 30px;
		box-shadow: 4px 4px 8px rgba(27,25,20,0.7);
		margin-left: -4%;
	}
</style>
<script language="javascript" type="text/javascript">  
      
     var code ; //在全局 定义验证码  
     function createCode()  
     {   
       code = "";  
       var codeLength = 4;//验证码的长度  
       var checkCode = document.getElementById("checkCode");  
       var selectChar = new Array(0,1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');//所有候选组成验证码的字符，当然也可以用中文的  
          
       for(var i=0;i<codeLength;i++)  
       {  
        
          
       var charIndex = Math.floor(Math.random()*36);  
       code +=selectChar[charIndex];  
         
         
       }  
//       alert(code);  
       if(checkCode)  
       {  
         checkCode.className="code";  
         checkCode.value = code;  
       }  
         
     }  
       
      function checkform()  
     {  
       var inputCode = document.getElementById("input1").value;  
       if(inputCode.length <=0)  
       {  
           alert("请输入验证码！");  
           return false;
       }  
       else if(inputCode != code )  
       {  
          alert("验证码输入错误！");  
          createCode();//刷新验证码  
          return false;
       }  
         return true;
       }
		
		function getlogin(){
			if(checkform()){
				if($('#user_account').val()=='' || $('#pwd').val() == ''){
					$('b').text('请输入用户或密码');
					//$('.tishi').css('display','block');
					//$('.tishi').text('请输入用户或密码');
					//alert('请输入用户或密码');
					return false;
				}else{
					$('b').text('');
				}

				$('#myform').submit();
			}
		}
         
    </script>

</head>
<body onload="createCode()">
<div class="bg">
   <div class="text">
	<?php echo form_open('login/info_post',array('id'=>'myform')); ?>
      	<div class="nei" style='width:40%;height:150px;'>
            <p><span>公益账号</span><input style="width:60%;" name="user_account" id="user_account" type="text" value="" /></p>
			<b></b>
            <p><span>账号密码</span><input style="width:60%;" name="pwd" id="pwd" type="password" value="" /></p>
			<p><span>验 证 码</span><input style="width:30%;" id="input1" type='text'><input type="text" onclick="createCode()" style="width:25%;margin-left:5%;font-size:16px;letter-spacing:4px;" readonly="readonly" id="checkCode" class="unchanged" /></p>
            <p id="btn_login" class="btn" style="margin-left:34%;">
            	<input style="width:67%;cursor:pointer;margin-left:7%;" type="button" onclick="getlogin()" value="" id='bnt-js'>
            </p>
            <p class="liji" style='position:relative;left:11%;'>
            	<span><a href="reg" style="color:#000000;margin-left:5px;" >立即注册</a></span>
   				<span><a href="forget" style="margin-right:5px;">找回密码</a></span>
   			</p>
    	</form>
        </div>
   </div>
</div>

</body>
</html>
<script type="text/javascript">
$(function(){
	$('.tishi').on('click',function(){
		$('.tishi').css('display','none');
	})
	$('#bnt-js').on('mousedown',function(){
		$('#bnt-js').css('margin-top','5px');
		//console.log(1)
	})
	$('#bnt-js').on('mouseup',function(){
		$('#bnt-js').css('margin-top','0');
		//console.log(2)
	})
	
/*	$('#btn_login').on('click', function(event) {
		
		if($('#user_account').val()=='' || $('#pwd').val() == ''){
			$('b').text('请输入用户或密码');
			//$('.tishi').css('display','block');
			//$('.tishi').text('请输入用户或密码');
			//alert('请输入用户或密码');
			return false;
		}else{
			$('b').text('');
		}
		$('#myform').submit();
	});
*/	$('.text').css('margin-left',-(parseInt($('.text').css('width'))/2));
	$('.text').css('height',$('.text').css('width')*0.82);
	$(window).resize(function(){  
		$('.text').css('margin-left',-(parseInt($('.text').css('width'))/2));
		$('.text').css('height',$('.text').css('width')*0.82);
		console.log($('.text').css('height'))
	});
	
})
</script>
